
function EraseFile()
{
	flashpoint();

	printf('# erases all images files on disk ');
	printf('# use with the StartCapture routines ');
	printf('# to continuously take/erase pictures ');
	
	
	writeMenu('"EraseFile"','"CMD"','"EraseFile()"');
	writeVariables();
	printf('# GetFileInfo parameters ');
	printf('declare s: spath,fname');
	printf('declare u: ulength ');
	printf('declare b: bstatus' );
	printf('# EraseFile parameters ');
	printf('declare u:  filecount, newfilecount  ');
	printf('# GetStorageStatus parameters ');

	printf('declare u: picturesLeft,taken,available  ');
	printf('declare i: rawCount  ');
  
	printf('<br>','#**** OPEN FILE ****');  
	printf('outFile="/System/ZErase.txt"');
	writeFileOpen();

	printf(' ');
	printf('WriteLine(fd,"   ")');
	printf('WriteLine(fd," erases all images files on disk ")');
	printf('WriteLine(fd," use with the StartCapture routines  ")');
	printf('WriteLine(fd," to continuously take/erase pictures  ")');
	printf('WriteLine(fd,"   ")');
	printf(' ');


  printf('# ERASE FILES ************************** ');

  printf('# ***************************** ');
  printf('WHILE_NEWFILE: ');
  printf('GetNewFileCount(uvar) ');
  printf('if uvar != 0 ');
  printf('Display(":") ');
  printf('Wait(5000) ');
  printf('goto WHILE_NEWFILE ');
  printf('end ');
  printf('DisplayClear() ');
  printf('# ***************************** ');

  printf('status=GetStorageStatus(taken, available, rawCount) ');
  printf('DisplayLine("avail[",status,"]=",available," ") ');
  printf('Write(fd, "avail[",status,"]=",available," ") ');

  printf('WriteLine(fd," ") ');
  printf('WriteLine(fd, "ERASE") ');

  printf('findex = 0 ');
  printf(' ');
  printf('ERASE: ');
  printf('GetTimeString( stime ) ');
  printf('GetFileCount(filecount) ');

  printf('status=GetFileInfo(findex,spath,fname,ulength,bstatus) ');
  printf('	if status==0 ');
  printf('	status=EraseFile( spath, fname) ');
  printf('	DisplayLine(filecount,") ",findex," [",status,"] ",fname ) ');
  printf('	WriteLine(fd,stime,":", filecount,") pic",findex," [",status,"] ",fname ) ');
  printf('  end ');
  
  printf(' Wait(10) ');
  printf(' ');
  printf('	  if filecount > 1 ');
  printf('	  goto ERASE ');
  printf('	  end ' );

  printf('FileClose( fd ) ');
  printf('#RunScript("still.csm")  ');


printf('exitscript');


	
}





